/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import da.AccountJpaController;
import entities.Account;
import javax.ejb.Stateless;

/**
 *
 * @author QUY_THI
 */
@Stateless
public class ChangeStatus implements ChangeStatusLocal {

    public void changeStatus(Account account) {
        try {
            AccountJpaController control = new AccountJpaController();
            if (account.getStatus()) {
                account.setStatus(Boolean.FALSE);
                control.edit(account);
            } else {
                account.setStatus(Boolean.TRUE);
                control.edit(account);
            }
        } catch (Exception e) {
        }
    }
    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")
}
